<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2018/9/26
 * Time: 15:29
 */
header("Content-Type:text/json;charset=utf-8");
header("Access-Control-Allow-Origin:*");
$hostname="localhost";
$username="root";
$userpwd="";
$dbname="shasha";
$dbport="3306";

//链接数据库
$link=new mysqli($hostname,$username,$userpwd,$dbname,$dbport);
//设置链接字符集
mysqli_query($link,"set names utf8");